package com.supplychainapi.service;

import com.joindata.inf.common.basic.exceptions.ServiceException;
import com.supplychainapi.common.RestResponse;
import com.supplychainapi.domain.LoginCache;
import com.supplychainapi.model.ScmTbdeliveraddr;
import com.supplychainapi.param.DeliverAddrParam;

import java.util.List;

/**
 * Created by panic .
 * Time 2017/11/23
 * description:地址管理服务接口crud
 */
public interface IScmTbDeliverAddrService {
    //    Create   Retrieve   Update  Delete
// TODO: 2017/11/23 地址管理服务

    /**
     * 新增地址
     *
     * @param model
     * @return
     * @throws ServiceException
     */
    RestResponse createAddr(LoginCache loginCache, DeliverAddrParam model) throws ServiceException;

    /**
     * 删除地址
     *
     * @param
     * @param fsShopGUID
     * @return
     * @throws ServiceException
     */
    RestResponse deleteAddr(String fsShopGUID, Integer addrId) throws ServiceException;


    /**
     * 更新修改地址
     *
     * @param
     * @return
     * @throws ServiceException
     */
    RestResponse updateAddr(LoginCache loginCache, DeliverAddrParam deliverAddrParam) throws ServiceException;


    /**
     * 查询地址列表
     *
     * @param shopGuid
     * @return
     * @throws ServiceException
     */
    RestResponse<List<ScmTbdeliveraddr>> retrieveAllAddr(String shopGuid) throws ServiceException;

    /**
     * 设置默认地址
     *
     * @param addressId
     * @param shopGuid
     * @return
     * @throws ServiceException
     */
    RestResponse setDefaultAddress(Integer addressId, String shopGuid) throws ServiceException;

    /**
     * 获取默认地址
     *
     * @param shopGuid
     * @return
     * @throws ServiceException
     */
    RestResponse<List<ScmTbdeliveraddr>> getDefaultAddress(String shopGuid) throws ServiceException;


    /**
     * 产生一个自增长id
     *
     * @param shopGuid
     * @return
     */
    String autoAddrId(String shopGuid);

}
